<script>
import service from "@/path/service"
import { useUserInfoStore } from '@/path/store/userInfo';
import { subscribeMessage } from "@/path/until"
export default {
  onLaunch: function () {
    const userStore = useUserInfoStore()
    if (!userStore.userInfo.token || userStore.userInfo.is_staff != 1 || userStore.userInfo.is_notice != 1) return
    subscribeMessage().then((res) => {
      if (res !== "reject") {
        return service.post("api/ycg/usercenter/setnotice")
      }
    })
  },
  onShow: function () {
    const userStore = useUserInfoStore()
    userStore.getUserInfo()
  },
  onHide: function () {
  },
}
</script>

<style lang="less">
@import url("./static/less/App.less");
@import url("./static/less/backimgs.less");
</style>
